package com.sxds.wn.security.dao;

import com.sxds.wn.dao.ibatis.AbstractIbatisDao;
import com.sxds.wn.exception.DataAccessException;
import com.sxds.wn.security.UserDao;
import com.sxds.wn.security.dto.User;

/**
 * 
 * Description: <p>陕西省地税渭南-餐饮业定税系统</p>
 * Content Desc:<p><p>
 * Copy Right of Sxdx-Wn
 * @author Andy
 * @version 1.0 Create Date:@2010-3-28
 */
public class UserDaoImp extends AbstractIbatisDao implements UserDao {

	private static final long serialVersionUID = 1203203L;

	/**
	 * 默认构造方法
	 */
	public UserDaoImp() {
		super();
	}

	public void addUser(User user) throws DataAccessException {
		getSqlMapClientTemplate().insert("insertUser",user);
	}

	public boolean checkExitsUser(User user) throws DataAccessException {
		return getSqlMapClientTemplate().queryForObject("queryUser",user)!=null;
	}

	public void deleteUser(User user) throws DataAccessException {
		getSqlMapClientTemplate().delete("deleteUser",user);
	}

	public void updateUser(User user) throws DataAccessException {
		getSqlMapClientTemplate().update("updateUser", user);
	}

	public User queryUser(User user) throws DataAccessException {
		return (User)getSqlMapClientTemplate().queryForObject("queryUser", user);
	}

}
